<template>
  <div class="infinite-container greenTop">
        <select-role2 @familychang="familychangHandle"></select-role2>
    <confirm-id :familyPerson="familyPerson" :person="person" :show.sync="showConfirm" ></confirm-id>
    <div v-show="!showConfirm">
      <white-block>
        <mu-flexbox slot="content" jusify="space-between" class="pd10" @click.native="to('/inpatient-care/list-bill')">
          <mu-flexbox-item  :grow="0" basis="60px">
            <i class="w-icon w-icon-zy_bc v-middle inline-block"></i>
          </mu-flexbox-item>
          <mu-flexbox-item>
            本次住院记录
          </mu-flexbox-item>
          <mu-flexbox-item :grow="0" basis="2em">
            <div class="iconfont icon-small-arrow-right t3"/>
          </mu-flexbox-item>
        </mu-flexbox>
        <mu-divider />
        <mu-flexbox slot="content" jusify="space-between" class="pd10" @click.native="to('/inpatient-care/list-hospitalization-record')">
          <mu-flexbox-item  :grow="0" basis="60px">
            <i class="w-icon w-icon-zy_ls v-middle inline-block"></i>
          </mu-flexbox-item>
          <mu-flexbox-item>
            历史住院记录
          </mu-flexbox-item>
          <mu-flexbox-item :grow="0" basis="2em">
            <div class="iconfont icon-small-arrow-right t3"/>
          </mu-flexbox-item>
        </mu-flexbox>
      </white-block>
      <ul class="bottomTip">
        <li>提示：仅支持查询最近一年内住院费用。</li>
      </ul>
    </div>
  </div>
</template>

<script>
  import SelectRole2 from '../../components/SelectRole2'
  import whiteBlock from '../../components/whiteBlock'
  import confirmId from '../../components/confirmId'
  export default {
    data () {
      return {
        familyPerson: JSON.parse(sessionStorage.familyPerson || '{}'),
        person: JSON.parse(sessionStorage.person),
        showConfirm: false
      }
    },
    components: {
      SelectRole2, whiteBlock, confirmId
    },
    mounted () {
      if (this.familyPerson.certificationValidityPeriod !== '1') {
        this.showConfirm = true
      } else {
        this.showConfirm = false
      }
    },
    methods: {
      familychangHandle (f) {
        this.familyPerson = f
      },
      to (url) {
        this.$router.push(url)
      }
    }
  }
</script>
